﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditFormColumn.aspx.cs" Inherits="Crm_EditFormColumn" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加修改表单字段</title>
    <link href="crm.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="js/lhgdialog/lhgdialog.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function()
        {           
            $("input[type=text]").keyup(function()
            {
               $.save();
            });
            jQuery.save=function()
            {
                 var strother = "";
                var cname = $.trim($("#txtCname").val());

                var name = $.trim($("#txtName").val());
                if (name != "")
                    strother += "id=\"" + name + "\" name=\"" + name + "\"";
                var type = $.trim($("#dropType").val());

                var width = $.trim($("#txtWidth").val());
                if (width != "")
                {
                    strother += " style=\"width:" + width + "px;\"";
                }
                var maxlength = $.trim($("#txtMaxLength").val());
                if (maxlength != "")
                {
                    strother += " maxlength=\"" + maxlength + "\"";

                }
                var px = $.trim($("#txtPx").val());
                var defaultvalue = $.trim($("#txtDefaultValue").val());
                if (defaultvalue != "")
                {
                    strother += " value=\"" + defaultvalue + "\"";
                }              

                var typestr = $("#hidtypestr").val();

                $("#txtHtmlStr").val(typestr.replace("{0}", strother));
            };
        });

        function Finish()
        {
            var DG = frameElement.lhgDG;
            DG.curWin.location.href = DG.curWin.location.href;
            DG.cancel();
        }    
    </script>

</head>
<body>
    <form id="form1" runat="server">   
    <div id="content">
        <table class="tblist" style="width: 500px; text-align: left">
            <colgroup>
                <col align="right" style="width: 100px;" class="bg1" />
            </colgroup>
            <tr class="ptitle" align="center">
                <td colspan="4" align="center">
                    添加/编辑表单字段
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    参数名称：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtCname" Width="200px" MaxLength="50" CssClass="inputtxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    名称：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtName" Width="200px" MaxLength="50" CssClass="inputtxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    类型：
                </td>
                <td colspan="3">
                    <div>
                        <asp:DropDownList ID="dropType" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="dropType_SelectedIndexChanged1">
                            <asp:ListItem Value="text">单行文本框</asp:ListItem>
                            <asp:ListItem Value="mutittext">多行文本框</asp:ListItem>
                            <asp:ListItem Value="UserID">下拉框</asp:ListItem>
                            <asp:ListItem Value="AdminID">单选框</asp:ListItem>
                            <asp:ListItem Value="AdminID">复选框</asp:ListItem>
                            <asp:ListItem Value="AdminID">数字型</asp:ListItem>
                            <asp:ListItem Value="AdminID">颜色选择器</asp:ListItem>
                            <asp:ListItem Value="AdminID">日期/时间</asp:ListItem>
                            <asp:ListItem Value="AdminID">验证码</asp:ListItem>
                            <asp:ListItem Value="text">系统处理</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    长度：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtWidth" Width="200px" MaxLength="50" CssClass="inputtxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    最大长度：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtMaxLength" Width="200px" MaxLength="50" CssClass="inputtxt" runat="server"></asp:TextBox>
                </td>
            </tr>            
            <tr>
                <td style="width: 100px">
                    排序值：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtPx" Width="200px" MaxLength="50" CssClass="inputtxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    默认值：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtDefaultValue" Width="100px" CssClass="inputtxt" MaxLength="100" runat="server"></asp:TextBox><input type="text" id="hidtypestr"  runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    描述：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtHtmlStr" Width="400px" Height="50px" TextMode="MultiLine" runat="server"></asp:TextBox>
                </td>
            </tr>          
            <tr>
                <td>
                </td>
                <td colspan="3">
                    <asp:Button ID="btnSubmit" runat="server" Text="提 交" OnClick="btnSubmit_Click" />
                    &nbsp;
                    <asp:Label ID="lblResult" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
